package com.nandi.deviceinstall.contract

import com.nandi.deviceinstall.base.BaseView
import com.nandi.deviceinstall.bean.*
import com.nandi.deviceinstall.net.dto.BindAddDTO
import com.nandi.deviceinstall.net.dto.BindUpdateDTO
import io.reactivex.Flowable
import okhttp3.ResponseBody
import java.io.File

interface EquipmentBindContract {
    interface Model {
        fun getListCity(token: String, district: String): Flowable<CityBean>

        fun getListTown(token: String, id: Int): Flowable<TownBean>

        fun getListDisaster(token: String, areaCode: String): Flowable<DisasterBean>

        fun getListMonitorNum(token: String, unifiedCode: String): Flowable<ListMonitorNumBean>

        fun executeDisNum(token: String, disName: String, areaCode: String): Flowable<DisNumBean>

        fun getListDevFactory(token: String,factory: String): Flowable<DeviceFacBean>

        fun executeUploadDevPic(token: String, file: File): Flowable<UploadPicBean>

        fun executeAddBind(token: String, params: BindAddDTO): Flowable<BaseObjectBean<BindAddBean>>

        fun executeUpdateBind(token: String, params: BindUpdateDTO): Flowable<BaseObjectBean<BindAddBean>>

        fun executeRemoveDevPicFile(token: String, path: String): Flowable<DevPicRemoveBean>

        fun executeListDisName(token: String, disasterName: String, town: String): Flowable<DisNameBean>
    }

    interface View : BaseView {
        override fun showLoading()

        override fun hideLoading()

        override fun onError(msg: String, code: Int)

        fun handlerListCityResult(result: CityBean)

        fun handlerListTownResult(result: TownBean)

        fun handlerListDisasterResult(result: DisasterBean)

        fun handlerDisNum(result: DisNumBean)

        fun handlerMonitorNum(result: ListMonitorNumBean)

        fun handlerDevFactory(result: DeviceFacBean)

        fun removeDevPicFile(result: DevPicRemoveBean)

        //fun downPicSuccess(result: ResponseBody, fileName: String, resultPath: String)

        fun uploadPicSuccess(result: UploadPicBean)

        fun handlerAddBindResult(result: BaseObjectBean<BindAddBean>)

        fun handlerUpdateBindResult(result: BaseObjectBean<BindAddBean>)

        fun handlerDisNameResult(result: DisNameBean)
    }

    interface Presenter {
        fun requestListTown(token: String, id: Int)

        fun requestListCity(token: String, district: String)

        fun requestListDisaster(token: String, areaCode: String)

        fun requestDisNum(token: String, disName: String, areaCode: String)

        fun requestListMonitorNum(token: String, unifiedCode: String)

        fun requestListDevFactory(token: String,factory: String)

        fun requestUploadDevPic(token: String, file: File)

        fun requestRemoveDevPicFile(token: String, path: String)

        fun requestAddBind(token: String, params: BindAddDTO)

        fun requestUpdateBind(token: String, params: BindUpdateDTO)

        fun requestDisName(token: String, disasterName: String, town: String)
    }
}